Printing Macintosh Printing Manager Documents
Documents printed with applications that use the Macintosh Printing Manager can be printed on a system with QuickDraw GX installed without the application being aware that QuickDraw GX is installed. Printing in this way, however, does not allow the application to take advantage of QuickDraw GX printing features, such as additional options provided in QuickDraw GX print dialog boxes, formatting, customization, and so on.You can modify an existing application to allow it to print a document designed for printing with the Macintosh Printing Manager by determining whether QuickDraw GX is installed and, if it is, performing these steps:
To convert the print record associated with a Macintosh Printing Manager document into a job object, use the
- Convert the print record associated with a Macintosh Printing Manager document into a job object.
- Install the QuickDraw GX Translator to convert the results of QuickDraw functions into special QuickDraw GX shape objects that are used to spool QuickDraw output.
- Execute your print loop. See the section "Printing Documents Using QuickDraw GX" beginning on page 2-20 for an example.
- Remove the QuickDraw GX Translator.
GXConvertPrintRecord
function. Listing 2-18 shows how to use theGXConvertPrintRecord
function.Listing 2-18 Converting a print record into a job object
OSErr MyPrintRecordToJob(MyDocumentPtr myDocument, THPrint hPrint) { /* Convert the print record and store its settings in the specified job object. Dispose of its handle. */ GXConvertPrintRecord(myDocument->documentJob, hPrint); DisposHandle((Handle) hPrint); return GXGetJobError(myDocument->documentJob); }In addition to converting the print record, you must also translate QuickDraw data using the QuickDraw GX Translator. You call theGXInstallQDTranslator
function to install the translator, and you call theGXRemoveQDTranslator
function when you are finished with the translation. The QuickDraw GX Translator and these functions are described in the QuickDraw GX environment chapter of Inside Macintosh: Environment and Utilities.After you call
GXInstallQDTranslator
, you proceed to print using the normal print loop; for example, by callingGXStartPage
to start a new page andGXFinishPage
to finish it. The results of any QuickDraw function is translated and the output is spooled. When you are finished printing, callGXRemoveQDTranslator
to end translation.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help